package com.chi.sort;

/**
 * @author chi  2017-07-27 17:40
 **/
public class QuickSort {

    public static void main(String[] args){
         int[] a = {2,5,6,3,9,4};
        int[] b = quickSort(a);
        System.out.println(b.toString());
    }

    private static int[] quickSort(int[] a) {

        return null;
    }


    void QuickSort(int[] array,int begin,int end){
        if(begin>end) return;
        int fir=begin;
        int sec=end;
        int key=array[begin];
        while(fir<sec){
            while(array[fir]<=key)
                fir++;
            while(array[sec]>=key)
                sec--;
            array[sec]=array[fir];
        }
        array[fir]=key;
        QuickSort(array,begin,fir-1);
        QuickSort(array,sec+1,end);
    }
}
